<template>
  <div class="not-found-container">
    <div class="not-found-card">
      <div class="icon-box">
        <svg viewBox="0 0 24 24" class="icon">
          <path
            fill="none"
            stroke="currentColor"
            stroke-width="1.5"
            stroke-linecap="round"
            stroke-linejoin="round"
            d="M9.75 9.75h.008v.008H9.75V9.75zm4.5 0h.008v.008H14.25V9.75zM21 12a9 9 0 11-18 0 9 9 0 0118 0zm-6 3.75a3 3 0 00-6 0h6z"
          />
        </svg>
      </div>
      <h1>404</h1>
      <h2>页面未找到</h2>
      <p>抱歉，您访问的页面不存在或已被删除。</p>
      <button @click="goHome">
        返回首页
      </button>
    </div>
  </div>
</template>

<script setup>
import { useRouter } from 'vue-router';
const router = useRouter();
const goHome = () => {
  router.push('/');
};
</script>

<style scoped>
.not-found-container {
  min-height: 100vh;
  background: linear-gradient(to bottom right, #e0e7ff, #fce7f3);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

.not-found-card {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  padding: 2rem 2.5rem;
  max-width: 400px;
  text-align: center;
  animation: fadeIn 0.6s ease-out;
}

.icon-box {
  margin-bottom: 1rem;
}

.icon {
  width: 64px;
  height: 64px;
  color: #6366f1;
}

h1 {
  font-size: 4rem;
  color: #4f46e5;
  margin: 0;
}

h2 {
  font-size: 1.5rem;
  margin: 0.5rem 0;
  color: #333;
}

p {
  color: #666;
  margin-bottom: 1.5rem;
}

button {
  padding: 0.6rem 1.4rem;
  background-color: #4f46e5;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

button:hover {
  background-color: #4338ca;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
</style>
